<!DOCTYPE html>
<html class="auth" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
  <head>
	<script type="text/javascript" th:src="@{/js/jquery-2.1.4.min.js}"></script>
	<script type="text/javascript" th:src="@{/js/jeexjj_sso_jsonp.js}"></script>
	
	<script type="text/javascript">
		function logon()
		{
			xjjsso.ssoLogonByJsonp("ssoForm",function(ssoUser){
				alert(ssoUser);
				//var obj = eval('(' + str + ')');
				//alert("前台得到了sso用户="+ssoUser);
			});
		}
		
		function logout()
		{
			xjjsso.ssoSignoutByJsonp(function(msg){
				alert("退出成功="+msg);
			});
		}
		
		function getSSOUser()
		{
			xjjsso.ssoAuthenticationByJsonp(function(ssoUser){
			
				var json = eval('(' + ssoUser + ')');
				console.info(json);
				alert(json.user.userName);
				//alert("验证前台得到了sso用户="+ssoUser);
			});
		}
	</script>
  </head>
  
  <body>
	<h1>sso jsonp登陆</h1>
  	<hr/>
    <form id="ssoForm">
    	账号:<input TYPE="text" NAME="identity" value=""/><br/>
    	密码:<input TYPE="text" NAME="password" value=""/><br/>
    	<br/>
		<INPUT TYPE="button" onclick="logon();" value="登陆"/>
		<INPUT TYPE="button" onclick="logout();" value="退出"/>
   	 	<INPUT TYPE="button" onclick="getSSOUser();" value="查看登陆用户"/>
    </form>
  </body>
</html>